import { createRouter, createWebHistory } from 'vue-router'
import home from '../views/home/home.vue'
import sosuo from '../views/home/sosuo.vue'

import index from '../views/home/children/index.vue'
import cla from '../views/home/children/cla.vue'
import cart from '../views/home/children/cart.vue'
import my from '../views/home/children/my.vue'
import bust from '../views/home/children/bust.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home/index'
    },

    {
      path: '/sosuo',
      name: 'sosuo',
      component: sosuo,
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children: [
        {
          path: 'index',
          name: 'index',
          component: index,
        },
        {
          path: 'cla',
          name: 'cla',
          component: cla,
        },
        {
          path: 'cart',
          name: 'cart',
          component: cart,
        },
        {
          path: 'my',
          name: 'my',
          component: my,
        },
        {
          path: 'bust',
          name: 'bust',
          component: bust,
        },
      ]
    },

  ],
})

export default router
